<template>
  <div>
      <h4>添加员工</h4>
        姓名:<input type="text" v-model="emObj.name"><br>
        电话:<input type="text" v-model="emObj.tel"><br>
        职位:<input type="text" v-model="emObj.job"><br>
         生日:<input type="date" v-model="emObj.birthDay"><br>
           头像：<input type="file" @change="getFile($event)"><br>
         <input type="submit" value="添加" @click="addEm()">
  </div>
</template>

<script>
export default {
    data(){
        return{
            emObj:{}
        }
    },
    methods:{
        getFile(event){
            //得到文件表单的dom对象
            this.emObj.img=event.target.files[0];
            // this.event=event;
             event.preventDefault();
        },
       async addEm(){
            var info = await this.ajax.uploadSubmit(this.emObj,"/project/em/add");
            alert(info);
        }
    }
}
</script>

<style>

</style>